﻿@{
    ViewBag.Title = "Index";
}

<h2>:: Examination Online Authentication ::</h2>
Session : @Session["IsLogin"]
Cookie : @HttpContext.Current.Request.Headers["Cookie"].IndexOf("ASP.NET_SessionId");
@using(Html.BeginForm())
{
    var usernameCookieValue = (Response.Cookies["username"] != null) ? Response.Cookies["username"].Value : "";
    var passwordCookieValue = (Response.Cookies["password"] != null) ? Response.Cookies["password"].Value : "";
    //var passwordCookieValue = (Response.Cookies["password"] != null) ? Response.Cookies["password"].Value : "";
    
    @Html.Label("UserName:") @Html.TextBox("username", usernameCookieValue)<br/>
    @Html.Label("Password:") @Html.Password("password", passwordCookieValue)<br/>
    @Html.CheckBox("remeber") @Html.Label("Remember me next time", Request.Cookies["username"]!=null) <br/>
    <input type="submit" value="Login"/>
    <input type="reset" value="Cancel"/>
}
